package edu.towson.greenteam.command;

import edu.towson.greenteam.InformationAggregator;
import edu.towson.greenteam.menu.MenuItem;
import edu.towson.greenteam.menu.Price;

public class CMDUpdateMenuitem implements Command
{
	InformationAggregator ia;
	int id;
	String name;
	String description;
	float currentPrice;
	float standardPrice;
	int rating;
	int maxQty;
	int currentQty;

	public CMDUpdateMenuitem(InformationAggregator ia, int id, String name, 
			String description, float currentPrice, float standardPrice, int rating, 
			int maxQty, int currentQty) {
		this.ia = ia;
		this.id = id;
		this.name = name;
		this.description = description;
		this.currentPrice = currentPrice;
		this.standardPrice = standardPrice;
		this.rating = rating;
		this.maxQty = maxQty;
		this.currentQty = currentQty;
	}

	@Override
	public Object execute() {	
		ia.getMenu().update(new MenuItem(id, name, description, 
				new Price(standardPrice, currentPrice), rating, maxQty, currentQty));
		return null;
	}


}
